package com.one.consumer.user.ui;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.one.common.config.RouterPath;
import com.one.common.manager.RouterManager;
import com.one.common.view.base.IListView;
import com.one.common.view.widget.MyTitleBar;
import com.one.consumer.BaseListActivityC;
import com.one.consumer.R;
import com.one.consumer.user.model.extra.InvoiceExtra;
import com.one.consumer.user.model.item.InvoiceItem;
import com.one.consumer.user.presenter.InvoiceListPresenter;
import com.one.consumer.user.ui.binder.InvoiceBinder;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/11/4 6:44 PM
 * description ： 开票记录列表
 **/
@Route(path = RouterPath.INVOICE_LIST)
public class InvoiceListActivity extends BaseListActivityC<InvoiceListPresenter> implements IListView {
    @Override
    protected void initPresenter() {
        mPresenter = new InvoiceListPresenter(this,this);
    }

    @Override
    public void registerDate() {
        register(InvoiceItem.class, new InvoiceBinder());
    }

    @Override
    public void loadData() {
        mPresenter.getInvoiceList();
//        addData(new InvoiceItem());
//        addData(new InvoiceItem());
    }

    @Override
    protected void initTitle() {
        super.initTitle();
        getMyTitleBar().setMode(MyTitleBar.Mode.BACK_TITLE_RIMG)
                .setTitleText("发票管理")
                .setRightImg(R.mipmap.ic_add_black);
    }

    @Override
    protected void onClickRightImg() {
        super.onClickRightImg();
        RouterManager.getInstance().go(RouterPath.ADD_LOOK_UP, new InvoiceExtra(InvoiceExtra.ADD));
    }

    @Override
    public boolean onEmpty() {
        return true;
    }

    @Override
    public void initData() {
        super.initData();
        loadData();
    }


}
